function generateTable(id, data){
	if (data.length > 0){				
		var table = $("<table class='table table-bordered table-hover table-striped'></table>");
		var header = $('<th>Description</th><th>Domain</th><th>Publish Date</th><th>Submit Date</th><th>Strike Price</th><th>Submitted Total Value</th><th>Award Value</th>');
		table.append(header);
		
		for(var i = 0; i < data.length; i ++){
			row = $('<tr></tr>');
			
			row.append($('<td></td>').html('<a href=/pricedetails/getPricedetailById?opportunityId='+data[i]['opportunityId']+' target="_blank">'+data[i]['description']+'</a>'));			
			row.append($('<td></td>').text(data[i]['domain']));			
			row.append($('<td></td>').text(data[i]['openDateAsString']));
			row.append($('<td></td>').text(data[i]['submitDateAsString']));
			row.append($('<td></td>').text("$"+data[i]['priceAsString']));
			row.append($('<td></td>').text("$"+data[i]['submittedTotalValueAsString']));
			row.append($('<td></td>').text("$" + format("#,##0.00",data[i]['awardValue'])));
			table.append(row);
		}
		$(id).fadeIn(100).html(table);				
	}		
	else{
		$(id).fadeIn(100).html('');
	}
	
	$('html body').animate({ scrollTop: $(document).height() }, 'slow');				
}

function generateInProgressTable(id, data){
	if (data.length > 0){				
		var table = $("<table class='table table-bordered table-hover table-striped'></table>");
		var header = $('<th>Description</th><th>Domain</th><th>Publish Date</th><th>Submit Date</th><th>Strike Price</th><th>Submitted Total Value</th>');
		table.append(header);
		
		for(var i = 0; i < data.length; i ++){
			row = $('<tr></tr>');
			
			row.append($('<td></td>').html('<a href=/pricedetails/getPricedetailById?opportunityId='+data[i]['opportunityId']+' target="_blank">'+data[i]['description']+'</a>'));			
			row.append($('<td></td>').text(data[i]['domain']));			
			row.append($('<td></td>').text(data[i]['openDateAsString']));
			row.append($('<td></td>').text(data[i]['submitDateAsString']));
			row.append($('<td></td>').text("$"+data[i]['priceAsString']));
			row.append($('<td></td>').text("$"+data[i]['submittedTotalValueAsString']));
			table.append(row);
		}
		$(id).fadeIn(100).html(table);				
	}		
	else{
		$(id).fadeIn(100).html('');
	}
	
	$('html body').animate({ scrollTop: $(document).height() }, 'slow');				
}

                       